home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / sun / misc / AtomicLongLockImpl.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  465 b   |  38 lines

  1. package sun.misc;
  2.  
  3. class AtomicLongLockImpl extends AtomicLong {
  4.    private volatile long value;
  5.  
  6.    protected AtomicLongLockImpl(long var1) {
  7.       this.value = var1;
  8.    }
  9.  
  10.    public long get() {
  11.       return this.value;
  12.    }
  13.  
  14.    public synchronized boolean attemptSet(long var1) {
  15.       this.value = var1;
  16.       return true;
  17.    }
  18.  
  19.    public synchronized boolean attemptUpdate(long var1, long var3) {
  20.       if (this.value == var1) {
  21.          this.value = var3;
  22.          return true;
  23.       } else {
  24.          return false;
  25.       }
  26.    }
  27.  
  28.    public synchronized boolean attemptIncrememt() {
  29.       ++this.value;
  30.       return true;
  31.    }
  32.  
  33.    public synchronized boolean attemptAdd(long var1) {
  34.       this.value += var1;
  35.       return true;
  36.    }
  37. }
  38.